﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Collections;

namespace sqxt
{
    public partial class physical_check : Form
    {
        public physical_check()
        {
            InitializeComponent();
        }
        string healthfile_no = "",name="",followupid="",lorc="";
        public physical_check(string  ss,string n,string f)
        {
            healthfile_no = ss;
            name = n;
            followupid = f;
            InitializeComponent();
        }
        bool chakan=false;
        public physical_check(string ss, string n, string f,bool  ck)
        {
            healthfile_no = ss;
            name = n;
            followupid = f;
            chakan = ck;
            InitializeComponent();
        }

        public physical_check(string hea, string n, string f,string pb)
        {
            healthfile_no = hea;
            name = n;
            followupid = f;
            lorc = pb;
            InitializeComponent();
        }
        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            if (!chakan)
            {
                dateTimePicker13.Text = DateTime.Parse(dateTimePicker1.Text).AddYears(1).ToShortDateString();
            }
        }
        SqlConnection conn = new SqlConnection(Dbconnect.s1);
        string isend = "";//标志居民是否已经归档
        private void physical_check_Load(object sender, EventArgs e)
        {
            this.Text = name+"的健康体检";
            textBoxX1.Text = name;
            textBoxX2.Text = healthfile_no;
           
                #region 读出随访时间
                conn.Open();
                SqlCommand sczz = new SqlCommand("select * from followup" + "  where  followup_id='" + followupid + "'", conn);
                SqlDataReader sdrzz = sczz.ExecuteReader();
                sdrzz.Read();
                {
                    if (!chakan)
                    {
                        dateTimePicker1.Value = DateTime.Parse(sdrzz["next_followup_date"].ToString());
                        comboBox5.Text = sdrzz["followup_doctor"].ToString();
                    }
                    else
                    {
                        dateTimePicker1.Value = DateTime.Parse(sdrzz["real_followup_date"].ToString());
                        dateTimePicker13.Value = DateTime.Parse(sdrzz["next_followup_date"].ToString());
                        comboBox5.Text = sdrzz["followup_doctor"].ToString();

                    }
                }
                conn.Close();
                sdrzz.Close();
                #endregion
                //dateTimePicker13.Value = dateTimePicker1.Value.AddYears(1); //DateTime.Now.AddYears(1).ToShortDateString();
           
            #region    combox添加下拉选项框
                ArrayList arrys = new ArrayList();
                SqlCommand comys = new SqlCommand("select empcode from employee ", conn);
                conn.Open();
                SqlDataReader sdrys = comys.ExecuteReader();
                while (sdrys.Read())
                {

                    arrys.Add(sdrys.GetString(0));
                }
                foreach (string s in arrys)
                {
                    comboBox5.Items.Add(s);
                }
                sdrys.Close();
                conn.Close();
                this.comboBox5.SelectedIndex = 0;
            comboBox1.Items.Add("粗筛阴性");
            comboBox1.Items.Add("粗筛阳性，简易智力状态检查");
            comboBox2.Items.Add("粗筛阴性");
            comboBox2.Items.Add("粗筛阳性，老年人抑郁评分检查");
            comboBox3.Items.Add("每天");
            comboBox3.Items.Add("每周一次以上");
            comboBox3.Items.Add("偶尔");
            comboBox3.Items.Add("不锻炼");
            comboBox4.Items.Add("从不吸烟");
            comboBox4.Items.Add("已戒烟");
            comboBox4.Items.Add("吸烟");
            comboBox6.Items.Add("从不");
            comboBox6.Items.Add("偶尔");
            comboBox6.Items.Add("经常");
            comboBox6.Items.Add("每天");
            comboBox7.Items.Add("听见");
            comboBox7.Items.Add("听不清");
            comboBox7.Items.Add("无法听见");
            comboBox8.Items.Add("可顺利完成");
            comboBox8.Items.Add("无法独立完成其中任何一个动作");
            comboBox9.Items.Add("齐");
            comboBox9.Items.Add("不齐");
            comboBox9.Items.Add("绝对不齐");
            comboBox10.Items.Add("无");
            comboBox10.Items.Add("单侧");
            comboBox10.Items.Add("双侧不对称");
            comboBox10.Items.Add("双侧对称");
            comboBox11.Items.Add("未触及");
            comboBox11.Items.Add("触及双侧对称");
            comboBox11.Items.Add("触及左侧弱或消失");
            comboBox11.Items.Add("触及左侧弱或消失");
            comboBox12.Items.Add("是");
            comboBox12.Items.Add("基本是");
            comboBox12.Items.Add("");
            comboBox13.Items.Add("是");
            comboBox13.Items.Add("基本是");
            comboBox13.Items.Add("");
            comboBox14.Items.Add("是");
            comboBox14.Items.Add("基本是");
            comboBox14.Items.Add("");
            comboBox15.Items.Add("是");
            comboBox15.Items.Add("基本是");
            comboBox15.Items.Add("");
            comboBox16.Items.Add("是");
            comboBox16.Items.Add("基本是");
            comboBox16.Items.Add("");
            comboBox17.Items.Add("是");
            comboBox17.Items.Add("基本是");
            comboBox17.Items.Add("");
            comboBox18.Items.Add("是");
            comboBox18.Items.Add("基本是");
            comboBox18.Items.Add("");
            comboBox19.Items.Add("是");
            comboBox19.Items.Add("基本是");
            comboBox19.Items.Add("");
            comboBox20.Items.Add("是");
            comboBox20.Items.Add("基本是");
            comboBox20.Items.Add("");
            comboBox39.Items.Add("体检无异常");
            comboBox39.Items.Add("有异常");
            comboBox40.Items.Add("门诊随访");
            comboBox40.Items.Add("家庭随访");
            comboBox40.Items.Add("电话随访");
            ArrayList fyycx = new ArrayList();
            fyycx.Add("规律");
            fyycx.Add("间断");
            fyycx.Add("不服药");
            foreach (string s in fyycx)
            {
                comboBox23.Items.Add(s);
                comboBox24.Items.Add(s);
                comboBox27.Items.Add(s);
                comboBox30.Items.Add(s);
                comboBox33.Items.Add(s);
                comboBox36.Items.Add(s);
            }
            ArrayList dw = new ArrayList();
            dw.Add("mg"); dw.Add("ml"); dw.Add("u");
            dw.Add("片"); dw.Add("剂"); dw.Add("盒");
            dw.Add("包"); dw.Add("瓶"); dw.Add("粒");
            foreach (string s in dw)
            {
                comboBox22.Items.Add(s);
                comboBox25.Items.Add(s);
                comboBox28.Items.Add(s);
                comboBox31.Items.Add(s);
                comboBox34.Items.Add(s);
                comboBox37.Items.Add(s);
            }
            #endregion

            #region  点击查看按钮进到页面，显示最后一次登记的体检的信息
            if (chakan)
            {
                try
                {
                    textBoxX1.Text = name;
                    textBoxX2.Text = healthfile_no;
                    SqlCommand sc;
                    SqlDataReader sdr;


                    #region  读出症状
                    conn.Open();
                    sc = new SqlCommand("select * from health_symptom" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        checkBox1.Checked = (bool)sdr["yesno"];
                        checkBox2.Checked = (bool)sdr["headache"];
                        checkBox3.Checked = (bool)sdr["touyun"];
                        checkBox5.Checked = (bool)sdr["xiongmen"];
                        checkBox6.Checked = (bool)sdr["xiongtong"];
                        checkBox7.Checked = (bool)sdr["mxkesou"];
                        checkBox14.Checked = (bool)sdr["ketan"];
                        checkBox13.Checked = (bool)sdr["hxkunnan"];
                        checkBox12.Checked = (bool)sdr["duoying"];
                        checkBox11.Checked = (bool)sdr["duoniao"];
                        checkBox10.Checked = (bool)sdr["tzxiajiang"];
                        checkBox9.Checked = (bool)sdr["fali"];
                        checkBox21.Checked = (bool)sdr["slmohu"];
                        checkBox8.Checked = (bool)sdr["gjzhongtong"];
                        checkBox20.Checked = (bool)sdr["sjmamu"];
                        checkBox19.Checked = (bool)sdr["niaoji"];
                        checkBox18.Checked = (bool)sdr["jiaotong"];
                        checkBox17.Checked = (bool)sdr["bimi"];
                        checkBox16.Checked = (bool)sdr["fuxie"];
                        checkBox15.Checked = (bool)sdr["exoutu"];
                        checkBox28.Checked = (bool)sdr["yanghua"];
                        checkBox27.Checked = (bool)sdr["erming"];
                        checkBox26.Checked = (bool)sdr["rfzhongtong"];
                        checkBox4.Checked = (bool)sdr["xingji"];
                        checkBox25.Checked = (bool)sdr["other"];

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出一般情况
                    conn.Open();
                    sc = new SqlCommand("select * from health_status" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        textBoxX5.Text = sdr["tiwen"].ToString();
                        textBoxX12.Text = sdr["mailv"].ToString();
                        textBoxX6.Text = sdr["hxpinglv"].ToString();
                        textBoxX16.Text = sdr["left_szy"].ToString();
                        textBoxX18.Text = sdr["left_shy"].ToString();
                        textBoxX17.Text = sdr["right_szy"].ToString();
                        textBoxX19.Text = sdr["right_sfy"].ToString();
                        textBoxX7.Text = sdr["shenggao"].ToString();
                        textBoxX13.Text = sdr["tizhong"].ToString();
                        textBoxX8.Text = sdr["yaowei"].ToString();
                        textBoxX14.Text = sdr["tzzhishu"].ToString();
                        textBoxX9.Text = sdr["tunwei"].ToString();
                        textBoxX15.Text = sdr["ytwbizhi"].ToString();
                        comboBox1.Text = sdr["lrrenzhi"].ToString();
                        textBoxX11.Text = sdr["rzzhongfeng"].ToString();
                        comboBox2.Text = sdr["lrqinggan"].ToString();
                        textBoxX10.Text = sdr["qgzhongfeng"].ToString();
                        comboBox40.Text = sdr["followup_class"].ToString();

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出生活方式
                    conn.Open();
                    sc = new SqlCommand("select * from health_lifeway" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        comboBox3.Text = sdr["dlpinglv"].ToString();
                        textBoxX20.Text = sdr["dlshijian"].ToString();
                        textBoxX21.Text = sdr["jcdlshijian"].ToString();
                        textBoxX22.Text = sdr["dlfangshi"].ToString();
                        textBoxX23.Text = sdr["jtxwshijian"].ToString();
                        comboBox4.Text = sdr["xyzhuangkuang"].ToString();
                        textBoxX24.Text = sdr["rxyl"].ToString();
                        textBoxX25.Text = sdr["startage"].ToString();
                        textBoxX27.Text = sdr["stopage"].ToString();
                        radioButton37.Checked = (bool)sdr["mzbdxyqky"];
                        radioButton38.Checked = (bool)sdr["mzbdxyqkn"];
                        comboBox6.Text = sdr["yjpinglv"].ToString();
                        textBoxX26.Text = sdr["yjliang"].ToString();
                        textBoxX29.Text = sdr["ksyjnl"].ToString();
                        radioButton2.Checked = (bool)sdr["sfjjy"];
                        radioButton1.Checked = (bool)sdr["sfjjn"];
                        textBoxX30.Text = sdr["jjage"].ToString();
                        radioButton4.Checked = (bool)sdr["ynzjy"];
                        radioButton3.Checked = (bool)sdr["ynzjn"];
                        textBoxX45.Text = sdr["jiye"].ToString();
                        textBoxX48.Text = sdr["cysj"].ToString();
                        textBoxX33.Text = sdr["hxp"].ToString();
                        textBoxX34.Text = sdr["duwu"].ToString();
                        textBoxX35.Text = sdr["shexian"].ToString();
                        radioButton7.Checked = (bool)sdr["hxpfhy"];
                        radioButton8.Checked = (bool)sdr["hxpfhn"];
                        radioButton9.Checked = (bool)sdr["dwfhy"];
                        radioButton10.Checked = (bool)sdr["dwfhn"];
                        radioButton11.Checked = (bool)sdr["sxfhy"];
                        radioButton12.Checked = (bool)sdr["sxfhn"];
                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出饮食习惯
                    conn.Open();
                    sc = new SqlCommand("select * from health_ysxg" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        checkBox22.Checked = (bool)sdr["ysjh"];
                        checkBox23.Checked = (bool)sdr["yswz"];
                        checkBox24.Checked = (bool)sdr["sswz"];
                        checkBox29.Checked = (bool)sdr["sy"];
                        checkBox30.Checked = (bool)sdr["shiy"];
                        checkBox31.Checked = (bool)sdr["st"];
                        checkBox36.Checked = (bool)sdr["baijiu"];
                        checkBox35.Checked = (bool)sdr["pijiu"];
                        checkBox34.Checked = (bool)sdr["hongjiu"];
                        checkBox33.Checked = (bool)sdr["huangjiu"];
                        checkBox32.Checked = (bool)sdr["other"];
                        textBoxX28.Text = sdr["other_nr"].ToString();

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出脏器功能
                    conn.Open();
                    sc = new SqlCommand("select * from health_viscera" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        checkBox41.Checked = (bool)sdr["kchr"];
                        checkBox40.Checked = (bool)sdr["kccb"];
                        checkBox39.Checked = (bool)sdr["kcfg"];
                        checkBox38.Checked = (bool)sdr["kcjl"];
                        checkBox37.Checked = (bool)sdr["kcbz"];
                        checkBox40.Checked = (bool)sdr["clzc"];
                        checkBox45.Checked = (bool)sdr["clqc"];
                        checkBox44.Checked = (bool)sdr["clyc"];
                        checkBox43.Checked = (bool)sdr["clyy"];
                        checkBox51.Checked = (bool)sdr["ybwcx"];
                        checkBox50.Checked = (bool)sdr["ybcx"];
                        checkBox49.Checked = (bool)sdr["ybzs"];
                        textBoxX36.Text = sdr["left_sl"].ToString();
                        textBoxX37.Text = sdr["right_sl"].ToString();
                        textBoxX38.Text = sdr["left_jzsl"].ToString();
                        textBoxX39.Text = sdr["right_jzsl"].ToString();
                        comboBox7.Text = sdr["tingli"].ToString();
                        comboBox8.Text = sdr["yundong"].ToString();
                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出查体信息
                    conn.Open();
                    sc = new SqlCommand("select * from health_check" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        textBoxX44.Text = sdr["xinglv"].ToString();
                        comboBox9.Text = sdr["xinglu"].ToString();
                        comboBox10.Text = sdr["xjshuizhong"].ToString();
                        comboBox11.Text = sdr["zbdmbd"].ToString();
                        checkBox55.Checked = (bool)sdr["pfzc"];
                        checkBox54.Checked = (bool)sdr["pfch"];
                        checkBox53.Checked = (bool)sdr["pfcb"];
                        checkBox52.Checked = (bool)sdr["pffg"];
                        checkBox48.Checked = (bool)sdr["pfhy"];
                        checkBox47.Checked = (bool)sdr["pfsscz"];
                        checkBox42.Checked = (bool)sdr["pfqt"];
                        textBoxX40.Text = sdr["other_nr"].ToString();
                        checkBox59.Checked = (bool)sdr["gmzc"];
                        checkBox58.Checked = (bool)sdr["gmhr"];
                        checkBox57.Checked = (bool)sdr["gmcx"];
                        checkBox56.Checked = (bool)sdr["gmqt"];
                        textBoxX41.Text = sdr["gmother_nr"].ToString();
                        checkBox63.Checked = (bool)sdr["lbjwcj"];
                        checkBox62.Checked = (bool)sdr["lbjsgs"];
                        checkBox61.Checked = (bool)sdr["lbjyw"];
                        checkBox60.Checked = (bool)sdr["lbjqt"];
                        textBoxX42.Text = sdr["lbjother_nr"].ToString();
                        radioButton6.Checked = (bool)sdr["tzxy"];
                        radioButton41.Checked = (bool)sdr["tzxn"];
                        radioButton43.Checked = (bool)sdr["hxyy"];
                        radioButton42.Checked = (bool)sdr["hxyn"];
                        checkBox71.Checked = (bool)sdr["lyw"];
                        checkBox70.Checked = (bool)sdr["lygly"];
                        checkBox69.Checked = (bool)sdr["lysly"];
                        checkBox68.Checked = (bool)sdr["lyqt"];
                        textBoxX43.Text = sdr["lyother_nr"].ToString();
                        radioButton54.Checked = (bool)sdr["xzzyw"];
                        radioButton55.Checked = (bool)sdr["xzzyy"];
                        textBoxX49.Text = sdr["xzzy_nr"].ToString();
                        radioButton44.Checked = (bool)sdr["ytw"];
                        radioButton45.Checked = (bool)sdr["yty"];
                        radioButton46.Checked = (bool)sdr["bkw"];
                        radioButton49.Checked = (bool)sdr["bky"];
                        radioButton47.Checked = (bool)sdr["gdw"];
                        radioButton50.Checked = (bool)sdr["gdy"];
                        radioButton48.Checked = (bool)sdr["bdw"];
                        radioButton50.Checked = (bool)sdr["bdy"];
                        radioButton53.Checked = (bool)sdr["ydxzyw"];
                        radioButton52.Checked = (bool)sdr["ydxzyy"];
                        checkBox91.Checked = (bool)sdr["gmzzwjyc"];
                        checkBox90.Checked = (bool)sdr["gmzzcj"];
                        checkBox89.Checked = (bool)sdr["gmzzbk"];
                        checkBox88.Checked = (bool)sdr["gmzzqlx"];
                        checkBox92.Checked = (bool)sdr["gmzzqt"];
                        textBoxX47.Text = sdr["gmzzother_nr"].ToString();
                        checkBox87.Checked = (bool)sdr["rxwjyc"];
                        checkBox86.Checked = (bool)sdr["rxrfqc"];
                        checkBox85.Checked = (bool)sdr["rxycmr"];
                        checkBox84.Checked = (bool)sdr["rxyxbk"];
                        checkBox93.Checked = (bool)sdr["rxqt"];
                        textBoxX46.Text = sdr["rxother_nr"].ToString();

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出查体妇科信息
                    conn.Open();
                    sc = new SqlCommand("select * from health_woman" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        radioButton27.Checked = (bool)sdr["wywyc"];
                        radioButton28.Checked = (bool)sdr["wyyc"];
                        radioButton29.Checked = (bool)sdr["ydwyc"];
                        radioButton33.Checked = (bool)sdr["ydyc"];
                        radioButton30.Checked = (bool)sdr["gjwyc"];
                        radioButton34.Checked = (bool)sdr["gjyc"];
                        radioButton31.Checked = (bool)sdr["gtwyc"];
                        radioButton35.Checked = (bool)sdr["gtyc"];
                        radioButton32.Checked = (bool)sdr["fjwyc"];
                        radioButton36.Checked = (bool)sdr["fjyc"];
                        textBoxX50.Text = sdr["wy_nr"].ToString();
                        textBoxX51.Text = sdr["yd_nr"].ToString();
                        textBoxX52.Text = sdr["gj_nr"].ToString();
                        textBoxX86.Text = sdr["gt_nr"].ToString();
                        textBoxX87.Text = sdr["fj_nr"].ToString();
                        textBoxX53.Text = sdr["other"].ToString();


                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出辅助检查信息
                    conn.Open();
                    sc = new SqlCommand("select * from health_assistant" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        textBoxX55.Text = sdr["kfxuetang"].ToString();
                        textBoxX56.Text = sdr["xhdanbai"].ToString();
                        textBoxX57.Text = sdr["bxibao"].ToString();
                        textBoxX58.Text = sdr["xxiaoban"].ToString();
                        textBoxX60.Text = sdr["xother"].ToString();
                        textBoxX63.Text = sdr["ndanbai"].ToString();
                        textBoxX62.Text = sdr["niaotang"].ToString();
                        textBoxX61.Text = sdr["ntongti"].ToString();
                        textBoxX64.Text = sdr["nqianxue"].ToString();
                        textBoxX60.Text = sdr["nother"].ToString();
                        radioButton25.Checked = (bool)sdr["dbqxn"];
                        radioButton26.Checked = (bool)sdr["dbqxy"];
                        textBoxX65.Text = sdr["nwldb"].ToString();
                        textBoxX69.Text = sdr["xqgbzam"].ToString();
                        textBoxX68.Text = sdr["xqgczam"].ToString();
                        textBoxX67.Text = sdr["bdanbai"].ToString();
                        textBoxX66.Text = sdr["zdhs"].ToString();
                        textBoxX74.Text = sdr["jhdhs"].ToString();
                        textBoxX73.Text = sdr["xqjg"].ToString();
                        textBoxX72.Text = sdr["xnsa"].ToString();
                        textBoxX71.Text = sdr["xjnd"].ToString();
                        textBoxX75.Text = sdr["xnnd"].ToString();
                        textBoxX78.Text = sdr["zdgc"].ToString();
                        textBoxX77.Text = sdr["gysz"].ToString();
                        textBoxX76.Text = sdr["xqdmdzdbdgc"].ToString();
                        textBoxX70.Text = sdr["xqgmdzdbdgc"].ToString();
                        textBoxX79.Text = sdr["thxhdb"].ToString();
                        radioButton13.Checked = (bool)sdr["ygbmkyy"];
                        radioButton14.Checked = (bool)sdr["ygbmkyn"];
                        radioButton15.Checked = (bool)sdr["ydzc"];
                        radioButton16.Checked = (bool)sdr["ydyc"];
                        textBoxX84.Text = sdr["ydyc_nr"].ToString();
                        radioButton17.Checked = (bool)sdr["xdtzc"];
                        radioButton21.Checked = (bool)sdr["xdtyc"];
                        textBoxX83.Text = sdr["xdtyc_nr"].ToString();
                        radioButton18.Checked = (bool)sdr["xbxsxzc"];
                        radioButton22.Checked = (bool)sdr["xbxsxyc"];
                        textBoxX82.Text = sdr["xbxsxyc_nr"].ToString();
                        radioButton19.Checked = (bool)sdr["bczc"];
                        radioButton23.Checked = (bool)sdr["bcyc"];
                        textBoxX81.Text = sdr["bcyc_nr"].ToString();
                        radioButton57.Checked = (bool)sdr["gjtpzc"];
                        radioButton56.Checked = (bool)sdr["gjtpyc"];
                        textBoxX88.Text = sdr["gjtpyc_nr"].ToString();
                        textBoxX89.Text = sdr["other"].ToString();
                        comboBox12.Text = sdr["pinghz"].ToString();
                        comboBox13.Text = sdr["qixz"].ToString();
                        comboBox14.Text = sdr["yangxz"].ToString();
                        comboBox15.Text = sdr["yinxz"].ToString();
                        comboBox16.Text = sdr["tansz"].ToString();
                        comboBox17.Text = sdr["shirz"].ToString();
                        comboBox18.Text = sdr["xueyz"].ToString();
                        comboBox19.Text = sdr["qiyz"].ToString();
                        comboBox20.Text = sdr["tebz"].ToString();


                    }
                    conn.Close();
                    sdr.Close();


                    #endregion

                    #region 读出现存主要健康问题
                    conn.Open();
                    sc = new SqlCommand("select * from health_issue" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        textBox2.Text = sdr["nxgqt_nr"].ToString();
                        checkBox105.Checked = (bool)sdr["sbwfx"];
                        checkBox100.Checked = (bool)sdr["sbtnbsb"];
                        checkBox101.Checked = (bool)sdr["sbsgnxj"];
                        checkBox102.Checked = (bool)sdr["sbjxsy"];
                        checkBox103.Checked = (bool)sdr["sbmxsy"];
                        checkBox104.Checked = (bool)sdr["sbqt"];
                        textBox3.Text = sdr["sbqt_nr"].ToString();
                        checkBox106.Checked = (bool)sdr["xzjbwfx"];
                        checkBox107.Checked = (bool)sdr["xzjbxjgs"];
                        checkBox108.Checked = (bool)sdr["xzjbxjt"];
                        checkBox109.Checked = (bool)sdr["xzjbgzdm"];
                        checkBox110.Checked = (bool)sdr["xzjbcxx"];
                        checkBox111.Checked = (bool)sdr["xzjbxqq"];
                        checkBox112.Checked = (bool)sdr["xzjbqt"];
                        textBox4.Text = sdr["xzjbqt_nr"].ToString();
                        checkBox113.Checked = (bool)sdr["xgjbwfx"];
                        checkBox114.Checked = (bool)sdr["xgjbjcdml"];
                        checkBox115.Checked = (bool)sdr["xgjbdmbs"];
                        checkBox116.Checked = (bool)sdr["xgjbqt"];
                        textBox5.Text = sdr["xgjbqt_nr"].ToString();
                        checkBox117.Checked = (bool)sdr["ybjbwfx"];
                        checkBox118.Checked = (bool)sdr["ybjbswmcx"];
                        checkBox119.Checked = (bool)sdr["ybjbsrtsz"];
                        checkBox120.Checked = (bool)sdr["ybjbbnz"];
                        checkBox121.Checked = (bool)sdr["ybjbqt"];
                        textBox6.Text = sdr["ybjbqt_nr"].ToString();
                        checkBox122.Checked = (bool)sdr["sjxtjbn"];
                        checkBox124.Checked = (bool)sdr["sjxtjby"];
                        textBox7.Text = sdr["sjxtjby_nr"].ToString();
                        checkBox123.Checked = (bool)sdr["qtxtjbn"];
                        checkBox125.Checked = (bool)sdr["qtxtjby"];
                        textBox8.Text = sdr["qtxtjb_nr"].ToString();


                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出住院情况
                    conn.Open();
                    sc = new SqlCommand("select * from health_inhospital" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    int zhuy = 0;
                    while (sdr.Read())
                    {
                        if (zhuy == 0)
                        {
                            dateTimePicker2.Value = DateTime.Parse(sdr["zyrq"].ToString());
                            dateTimePicker3.Value = DateTime.Parse(sdr["cyrq"].ToString());
                            textBox9.Text = sdr["yuanying"].ToString();
                            textBox10.Text = sdr["hostipal"].ToString();
                            textBox11.Text = sdr["bah"].ToString();
                            dateTimePicker9.Value = DateTime.Parse(sdr["jtbc_jcsj"].ToString());
                            dateTimePicker8.Value = DateTime.Parse(sdr["jtbc_ccsj"].ToString());
                            textBox20.Text = sdr["jtbc_yy"].ToString();
                            textBox19.Text = sdr["jtbc_hostipal"].ToString();
                            textBox18.Text = sdr["jtbc_bah"].ToString();

                        }
                        if (zhuy == 1)
                        {
                            dateTimePicker4.Value = DateTime.Parse(sdr["zyrq"].ToString());
                            dateTimePicker5.Value = DateTime.Parse(sdr["cyrq"].ToString());
                            textBox12.Text = sdr["yuanying"].ToString();
                            textBox13.Text = sdr["hostipal"].ToString();
                            textBox14.Text = sdr["bah"].ToString();
                            dateTimePicker7.Value = DateTime.Parse(sdr["jtbc_jcsj"].ToString());
                            dateTimePicker6.Value = DateTime.Parse(sdr["jtbc_ccsj"].ToString());
                            textBox17.Text = sdr["jtbc_yy"].ToString();
                            textBox16.Text = sdr["jtbc_hostipal"].ToString();
                            textBox15.Text = sdr["jtbc_bah"].ToString();


                        }
                        zhuy = zhuy + 1;


                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出用药情况
                    conn.Open();
                    sc = new SqlCommand("select * from health_medicine" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    int yongy = 0;
                    while (sdr.Read())
                    {
                        if (yongy == 0)
                        {
                            textBox21.Text = sdr["yaoming"].ToString();
                            textBox52.Text = sdr["yongfa"].ToString();
                            textBox22.Text = sdr["yongliang"].ToString();
                            comboBox22.Text = sdr["danwei"].ToString();
                            textBox23.Text = sdr["yysj"].ToString();
                            comboBox23.Text = sdr["fyycx"].ToString();

                        }
                        if (yongy == 1)
                        {
                            textBox26.Text = sdr["yaoming"].ToString();
                            textBox53.Text = sdr["yongfa"].ToString();
                            textBox25.Text = sdr["yongliang"].ToString();
                            comboBox25.Text = sdr["danwei"].ToString();
                            textBox24.Text = sdr["yysj"].ToString();
                            comboBox24.Text = sdr["fyycx"].ToString();


                        }
                        if (yongy == 2)
                        {
                            textBox29.Text = sdr["yaoming"].ToString();
                            textBox54.Text = sdr["yongfa"].ToString();
                            textBox28.Text = sdr["yongliang"].ToString();
                            comboBox28.Text = sdr["danwei"].ToString();
                            textBox27.Text = sdr["yysj"].ToString();
                            comboBox27.Text = sdr["fyycx"].ToString();

                        }
                        if (yongy == 3)
                        {
                            textBox32.Text = sdr["yaoming"].ToString();
                            textBox55.Text = sdr["yongfa"].ToString();
                            textBox31.Text = sdr["yongliang"].ToString();
                            comboBox31.Text = sdr["danwei"].ToString();
                            textBox30.Text = sdr["yysj"].ToString();
                            comboBox30.Text = sdr["fyycx"].ToString();


                        }
                        if (yongy == 4)
                        {
                            textBox35.Text = sdr["yaoming"].ToString();
                            textBox56.Text = sdr["yongfa"].ToString();
                            textBox34.Text = sdr["yongliang"].ToString();
                            comboBox34.Text = sdr["danwei"].ToString();
                            textBox33.Text = sdr["yysj"].ToString();


                        }
                        if (yongy == 5)
                        {
                            textBox35.Text = sdr["yaoming"].ToString();
                            textBox56.Text = sdr["yongfa"].ToString();
                            textBox34.Text = sdr["yongliang"].ToString();
                            comboBox34.Text = sdr["danwei"].ToString();
                            textBox33.Text = sdr["yysj"].ToString();
                            comboBox33.Text = sdr["fyycx"].ToString();

                        }
                        yongy = yongy + 1;

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region 读出非免疫接种
                    conn.Open();
                    sc = new SqlCommand("select * from health_myjz" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    int miany = 0;
                    while (sdr.Read())
                    {
                        if (miany == 0)
                        {
                            textBox39.Text = sdr["jzmc"].ToString();
                            dateTimePicker10.Value = DateTime.Parse(sdr["jzrq"].ToString());
                            textBox40.Text = sdr["jzjg"].ToString();

                        }
                        if (miany == 1)
                        {
                            textBox42.Text = sdr["jzmc"].ToString();
                            dateTimePicker11.Value = DateTime.Parse(sdr["jzrq"].ToString());
                            textBox41.Text = sdr["jzjg"].ToString();

                        }
                        if (miany == 2)
                        {
                            textBox44.Text = sdr["jzmc"].ToString();
                            dateTimePicker12.Value = DateTime.Parse(sdr["jzrq"].ToString());
                            textBox43.Text = sdr["jzjg"].ToString();

                        }
                        miany = miany + 1;

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region  读出健康评价
                    conn.Open();
                    sc = new SqlCommand("select * from health_opinion" + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        comboBox39.Text = sdr["jkpj_sf"].ToString();
                        textBox45.Text = sdr["jkpj_yc1"].ToString();
                        textBox46.Text = sdr["jkpj_yc2"].ToString();
                        textBox47.Text = sdr["jkpj_yc3"].ToString();
                        textBox48.Text = sdr["jkpj_yc1"].ToString();

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    #region  读出健康指导内容
                    conn.Open();
                    sc = new SqlCommand("select * from health_vote " + "  where  followup_id='" + followupid + "'", conn);
                    sdr = sc.ExecuteReader();
                    sdr.Read();
                    {
                        checkBox129.Checked = (bool)sdr["dqsf"];
                        checkBox128.Checked = (bool)sdr["mxbgl"];
                        checkBox127.Checked = (bool)sdr["jyfc"];
                        checkBox126.Checked = (bool)sdr["jyzz"];
                        checkBox130.Checked = (bool)sdr["wjy"];
                        checkBox131.Checked = (bool)sdr["wjkyj"];
                        checkBox132.Checked = (bool)sdr["wys"];
                        checkBox133.Checked = (bool)sdr["wdl"];
                        checkBox134.Checked = (bool)sdr["wjtz"];
                        textBox49.Text = sdr["wjtz_mb"].ToString();
                        checkBox135.Checked = (bool)sdr["wymjz"];
                        textBox50.Text = sdr["wymjz_ym"].ToString();
                        checkBox136.Checked = (bool)sdr["other"];
                        textBox51.Text = sdr["other_nr"].ToString();

                    }
                    conn.Close();
                    sdr.Close();
                    #endregion

                    
                }
                catch (Exception e1)
                {
                    
                }
            }
            #endregion

            #region  读出是否归档
            conn.Open();
            SqlCommand scgd = new SqlCommand("select * from person" + "  where  person_healthfile_no='" + healthfile_no + "'", conn);
           SqlDataReader sdrgd = scgd.ExecuteReader();
            sdrgd.Read();
            {
                isend = sdrgd["person_isend"].ToString().Trim();
            }
            conn.Close();
            sdrgd.Close();
            #endregion







        }

        private void textBoxX13_TextChanged(object sender, EventArgs e)
        {
            if (textBoxX7.Text != "" && textBoxX13.Text!="")
            {
                float i2 = Convert.ToSingle(textBoxX7.Text);
                float i1=Convert.ToSingle(textBoxX13.Text) * Convert.ToSingle(textBoxX13.Text);
                textBoxX14.Text = (i1/i2).ToString("F2");
            }
            else
            {
                textBoxX14.Text = "0";
            }
        }


        private void textBoxX9_TextChanged(object sender, EventArgs e)
        {
            if (textBoxX9.Text != "" && textBoxX8.Text!="")
            {
                float i1 = Convert.ToSingle(textBoxX8.Text) / Convert.ToSingle(textBoxX9.Text);
                textBoxX15.Text = (i1).ToString("F2");
            }
            else
            {
                textBoxX15.Text = "0";
            }

        }
        string folid = "";
        bool bc = false;  //是否第一次点击保存
        SqlDataAdapter sda;
        DataTable dt;
        DataRow dr;
        SqlCommandBuilder scb;
        private void toolStripButton1_Click(object sender, EventArgs e) //保存
        {
            if (!bc)
            {
                try
                {

                    if (isend != "归档")
                    {

                        if (!chakan)
                        {

                            string folid = followupid;
                            #region  更新followup表的记录
                            sda = new SqlDataAdapter("select * from followup", Dbconnect.s1);
                            DataTable dtxg = new DataTable();
                            sda.Fill(dtxg);
                            dtxg.PrimaryKey = new DataColumn[] { dtxg.Columns[0] };
                            DataRow drxg = dtxg.Rows.Find(followupid);
                            drxg[3] = dateTimePicker1.Value.ToShortTimeString();
                            drxg[5] = comboBox5.Text.Trim();
                            drxg[6] = dateTimePicker1.Value.ToShortDateString();
                            drxg[7] = "已完成";
                            SqlCommandBuilder scbxg = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { drxg });

                            #endregion

                            #region   保存症状


                            sda = new SqlDataAdapter("select * from health_symptom", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["yesno"] = checkBox1.Checked;
                            dr["headache"] = checkBox2.Checked;
                            dr["touyun"] = checkBox3.Checked;
                            dr["xiongmen"] = checkBox5.Checked;
                            dr["xiongtong"] = checkBox6.Checked;
                            dr["mxkesou"] = checkBox7.Checked;
                            dr["ketan"] = checkBox14.Checked;
                            dr["hxkunnan"] = checkBox13.Checked;
                            dr["duoying"] = checkBox12.Checked;
                            dr["duoniao"] = checkBox11.Checked;
                            dr["tzxiajiang"] = checkBox10.Checked;
                            dr["fali"] = checkBox9.Checked;
                            dr["slmohu"] = checkBox21.Checked;
                            dr["gjzhongtong"] = checkBox8.Checked;
                            dr["sjmamu"] = checkBox20.Checked;
                            dr["niaoji"] = checkBox19.Checked;
                            dr["jiaotong"] = checkBox18.Checked;
                            dr["bimi"] = checkBox17.Checked;
                            dr["fuxie"] = checkBox16.Checked;
                            dr["exoutu"] = checkBox15.Checked;
                            dr["yanghua"] = checkBox28.Checked;
                            dr["erming"] = checkBox27.Checked;
                            dr["rfzhongtong"] = checkBox26.Checked;
                            dr["xingji"] = checkBox4.Checked;
                            dr["other"] = checkBox25.Checked;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);


                            #endregion

                            #region   保存一般情况
                            sda = new SqlDataAdapter("select * from health_status", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["tiwen"] = textBoxX5.Text.ToString();
                            dr["mailv"] = textBoxX12.Text.ToString();
                            dr["hxpinglv"] = textBoxX6.Text.ToString();
                            dr["left_szy"] = textBoxX16.Text.ToString();
                            dr["left_shy"] = textBoxX18.Text.ToString();
                            dr["right_szy"] = textBoxX17.Text.ToString();
                            dr["right_sfy"] = textBoxX19.Text.ToString();
                            dr["shenggao"] = textBoxX7.Text.ToString();
                            dr["tizhong"] = textBoxX13.Text.ToString();
                            dr["yaowei"] = textBoxX8.Text.ToString();
                            dr["tzzhishu"] = textBoxX14.Text.ToString();
                            dr["tunwei"] = textBoxX9.Text.ToString();
                            dr["ytwbizhi"] = textBoxX15.Text.ToString();
                            dr["lrrenzhi"] = comboBox1.Text;
                            dr["rzzhongfeng"] = textBoxX11.Text.ToString();
                            dr["lrqinggan"] = comboBox2.Text;
                            dr["qgzhongfeng"] = textBoxX10.Text.ToString();
                            dr["followup_class"] = comboBox40.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);

                            #endregion

                            #region  保存生活方式
                            sda = new SqlDataAdapter("select * from health_lifeway", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["dlpinglv"] = comboBox3.Text;
                            dr["dlshijian"] = textBoxX20.Text;
                            dr["jcdlshijian"] = textBoxX21.Text;
                            dr["dlfangshi"] = textBoxX22.Text;
                            dr["jtxwshijian"] = textBoxX23.Text;
                            dr["xyzhuangkuang"] = comboBox4.Text;
                            dr["rxyl"] = textBoxX24.Text;
                            dr["startage"] = textBoxX25.Text;
                            dr["stopage"] = textBoxX27.Text;
                            dr["mzbdxyqky"] = radioButton37.Checked;
                            dr["mzbdxyqkn"] = radioButton38.Checked;
                            dr["yjpinglv"] = comboBox6.Text;
                            dr["yjliang"] = textBoxX26.Text;
                            dr["ksyjnl"] = textBoxX29.Text;
                            dr["sfjjy"] = radioButton2.Checked;
                            dr["sfjjn"] = radioButton1.Checked;
                            dr["jjage"] = textBoxX30.Text;
                            dr["ynzjy"] = radioButton4.Checked;
                            dr["ynzjn"] = radioButton3.Checked;
                            dr["jiye"] = textBoxX45.Text;
                            dr["cysj"] = textBoxX48.Text;
                            dr["hxp"] = textBoxX33.Text;
                            dr["duwu"] = textBoxX34.Text;
                            dr["shexian"] = textBoxX35.Text;
                            dr["hxpfhy"] = radioButton7.Checked;
                            dr["hxpfhn"] = radioButton8.Checked;
                            dr["dwfhy"] = radioButton9.Checked;
                            dr["dwfhn"] = radioButton10.Checked;
                            dr["sxfhy"] = radioButton11.Checked;
                            dr["sxfhn"] = radioButton12.Checked;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region  保存饮食习惯
                            sda = new SqlDataAdapter("select * from health_ysxg", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["ysjh"] = checkBox22.Checked;
                            dr["yswz"] = checkBox23.Checked;
                            dr["sswz"] = checkBox24.Checked;
                            dr["sy"] = checkBox29.Checked;
                            dr["shiy"] = checkBox30.Checked;
                            dr["st"] = checkBox31.Checked;
                            dr["baijiu"] = checkBox36.Checked;
                            dr["pijiu"] = checkBox35.Checked;
                            dr["hongjiu"] = checkBox34.Checked;
                            dr["huangjiu"] = checkBox33.Checked;
                            dr["other"] = checkBox32.Checked;
                            dr["other_nr"] = textBoxX28.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region  保存脏器功能
                            sda = new SqlDataAdapter("select * from health_viscera", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["kchr"] = checkBox41.Checked;
                            dr["kccb"] = checkBox40.Checked;
                            dr["kcfg"] = checkBox39.Checked;
                            dr["kcjl"] = checkBox38.Checked;
                            dr["kcbz"] = checkBox37.Checked;
                            dr["clzc"] = checkBox40.Checked;
                            dr["clqc"] = checkBox45.Checked;
                            dr["clyc"] = checkBox44.Checked;
                            dr["clyy"] = checkBox43.Checked;
                            dr["ybwcx"] = checkBox51.Checked;
                            dr["ybcx"] = checkBox50.Checked;
                            dr["ybzs"] = checkBox49.Checked;
                            dr["left_sl"] = textBoxX36.Text;
                            dr["right_sl"] = textBoxX37.Text;
                            dr["left_jzsl"] = textBoxX38.Text;
                            dr["right_jzsl"] = textBoxX39.Text;
                            dr["tingli"] = comboBox7.Text;
                            dr["yundong"] = comboBox8.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region 保存查体
                            sda = new SqlDataAdapter("select * from health_check", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["xinglv"] = textBoxX44.Text.ToString();
                            dr["xinglu"] = comboBox9.Text;
                            dr["xjshuizhong"] = comboBox10.Text;
                            dr["zbdmbd"] = comboBox11.Text;
                            dr["pfzc"] = checkBox55.Checked;
                            dr["pfch"] = checkBox54.Checked;
                            dr["pfcb"] = checkBox53.Checked;
                            dr["pffg"] = checkBox52.Checked;
                            dr["pfhy"] = checkBox48.Checked;
                            dr["pfsscz"] = checkBox47.Checked;
                            dr["pfqt"] = checkBox42.Checked;
                            dr["other_nr"] = textBoxX40.Text;
                            dr["gmzc"] = checkBox59.Checked;
                            dr["gmhr"] = checkBox58.Checked;
                            dr["gmcx"] = checkBox57.Checked;
                            dr["gmqt"] = checkBox56.Checked;
                            dr["gmother_nr"] = textBoxX41.Text;
                            dr["lbjwcj"] = checkBox63.Checked;
                            dr["lbjsgs"] = checkBox62.Checked;
                            dr["lbjyw"] = checkBox61.Checked;
                            dr["lbjqt"] = checkBox60.Checked;
                            dr["lbjother_nr"] = textBoxX42.Text;
                            dr["tzxy"] = radioButton6.Checked;
                            dr["tzxn"] = radioButton41.Checked;
                            dr["hxyy"] = radioButton43.Checked;
                            dr["hxyn"] = radioButton42.Checked;
                            dr["lyw"] = checkBox71.Checked;
                            dr["lygly"] = checkBox70.Checked;
                            dr["lysly"] = checkBox69.Checked;
                            dr["lyqt"] = checkBox68.Checked;
                            dr["lyother_nr"] = textBoxX43.Text;
                            dr["xzzyw"] = radioButton54.Checked;
                            dr["xzzyy"] = radioButton55.Checked;
                            dr["xzzy_nr"] = textBoxX49.Text;
                            dr["ytw"] = radioButton44.Checked;
                            dr["yty"] = radioButton45.Checked;
                            dr["bkw"] = radioButton46.Checked;
                            dr["bky"] = radioButton49.Checked;
                            dr["gdw"] = radioButton47.Checked;
                            dr["gdy"] = radioButton50.Checked;
                            dr["bdw"] = radioButton48.Checked;
                            dr["bdy"] = radioButton50.Checked;
                            dr["ydxzyw"] = radioButton53.Checked;
                            dr["ydxzyy"] = radioButton52.Checked;
                            dr["gmzzwjyc"] = checkBox91.Checked;
                            dr["gmzzcj"] = checkBox90.Checked;
                            dr["gmzzbk"] = checkBox89.Checked;
                            dr["gmzzqlx"] = checkBox88.Checked;
                            dr["gmzzqt"] = checkBox92.Checked;
                            dr["gmzzother_nr"] = textBoxX47.Text;
                            dr["rxwjyc"] = checkBox87.Checked;
                            dr["rxrfqc"] = checkBox86.Checked;
                            dr["rxycmr"] = checkBox85.Checked;
                            dr["rxyxbk"] = checkBox84.Checked;
                            dr["rxqt"] = checkBox93.Checked;
                            dr["rxother_nr"] = textBoxX46.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);


                            #endregion

                            #region 保存查体妇科
                            sda = new SqlDataAdapter("select * from health_woman", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["wywyc"] = radioButton27.Checked;
                            dr["wyyc"] = radioButton28.Checked;
                            dr["ydwyc"] = radioButton29.Checked;
                            dr["ydyc"] = radioButton33.Checked;
                            dr["gjwyc"] = radioButton30.Checked;
                            dr["gjyc"] = radioButton34.Checked;
                            dr["gtwyc"] = radioButton31.Checked;
                            dr["gtyc"] = radioButton35.Checked;
                            dr["fjwyc"] = radioButton32.Checked;
                            dr["fjyc"] = radioButton36.Checked;
                            dr["wy_nr"] = textBoxX50.Text;
                            dr["yd_nr"] = textBoxX51.Text;
                            dr["gj_nr"] = textBoxX52.Text;
                            dr["gt_nr"] = textBoxX86.Text;
                            dr["fj_nr"] = textBoxX87.Text;
                            dr["other"] = textBoxX53.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region 保存辅助检查
                            sda = new SqlDataAdapter("select * from health_assistant", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["kfxuetang"] = textBoxX55.Text.ToString();
                            dr["xhdanbai"] = textBoxX56.Text.ToString();
                            dr["bxibao"] = textBoxX57.Text.ToString();
                            dr["xxiaoban"] = textBoxX58.Text.ToString();
                            dr["xother"] = textBoxX60.Text;
                            dr["ndanbai"] = textBoxX63.Text.ToString();
                            dr["niaotang"] = textBoxX62.Text.ToString();
                            dr["ntongti"] = textBoxX61.Text.ToString();
                            dr["nqianxue"] = textBoxX64.Text.ToString();
                            dr["nother"] = textBoxX60.Text;
                            dr["dbqxn"] = radioButton25.Checked;
                            dr["dbqxy"] = radioButton26.Checked;
                            dr["nwldb"] = textBoxX65.Text.ToString();
                            dr["xqgbzam"] = textBoxX69.Text.ToString();
                            dr["xqgczam"] = textBoxX68.Text.ToString();
                            dr["bdanbai"] = textBoxX67.Text.ToString();
                            dr["zdhs"] = textBoxX66.Text.ToString();
                            dr["jhdhs"] = textBoxX74.Text.ToString();
                            dr["xqjg"] = textBoxX73.Text.ToString();
                            dr["xnsa"] = textBoxX72.Text.ToString();
                            dr["xjnd"] = textBoxX71.Text.ToString();
                            dr["xnnd"] = textBoxX75.Text.ToString();
                            dr["zdgc"] = textBoxX78.Text.ToString();
                            dr["gysz"] = textBoxX77.Text.ToString();
                            dr["xqdmdzdbdgc"] = textBoxX76.Text.ToString();
                            dr["xqgmdzdbdgc"] = textBoxX70.Text.ToString();
                            dr["thxhdb"] = textBoxX79.Text.ToString();
                            dr["ygbmkyy"] = radioButton13.Checked;
                            dr["ygbmkyn"] = radioButton14.Checked;
                            dr["ydzc"] = radioButton15.Checked;
                            dr["ydyc"] = radioButton16.Checked;
                            dr["ydyc_nr"] = textBoxX84.Text;
                            dr["xdtzc"] = radioButton17.Checked;
                            dr["xdtyc"] = radioButton21.Checked;
                            dr["xdtyc_nr"] = textBoxX83.Text;
                            dr["xbxsxzc"] = radioButton18.Checked;
                            dr["xbxsxyc"] = radioButton22.Checked;
                            dr["xbxsxyc_nr"] = textBoxX82.Text;
                            dr["bczc"] = radioButton19.Checked;
                            dr["bcyc"] = radioButton23.Checked;
                            dr["bcyc_nr"] = textBoxX81.Text;
                            dr["gjtpzc"] = radioButton57.Checked;
                            dr["gjtpyc"] = radioButton56.Checked;
                            dr["gjtpyc_nr"] = textBoxX88.Text;
                            dr["other"] = textBoxX89.Text;
                            dr["pinghz"] = comboBox12.Text;
                            dr["qixz"] = comboBox13.Text;
                            dr["yangxz"] = comboBox14.Text;
                            dr["yinxz"] = comboBox15.Text;
                            dr["tansz"] = comboBox16.Text;
                            dr["shirz"] = comboBox17.Text;
                            dr["xueyz"] = comboBox18.Text;
                            dr["qiyz"] = comboBox19.Text;
                            dr["tebz"] = comboBox20.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);



                            #endregion

                            #region 保存现存主要健康问题
                            sda = new SqlDataAdapter("select * from health_issue", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["nxgjwfx"] = checkBox94.Checked;
                            dr["nxgqxzz"] = checkBox95.Checked;
                            dr["nxgncx"] = checkBox96.Checked;
                            dr["nxgzwmxqcx"] = checkBox97.Checked;
                            dr["nxgdzxqx"] = checkBox98.Checked;
                            dr["nxgqt"] = checkBox99.Checked;
                            dr["nxgqt_nr"] = textBox2.Text;
                            dr["sbwfx"] = checkBox105.Checked;
                            dr["sbtnbsb"] = checkBox100.Checked;
                            dr["sbsgnxj"] = checkBox101.Checked;
                            dr["sbjxsy"] = checkBox102.Checked;
                            dr["sbmxsy"] = checkBox103.Checked;
                            dr["sbqt"] = checkBox104.Checked;
                            dr["sbqt_nr"] = textBox3.Text;
                            dr["xzjbwfx"] = checkBox106.Checked;
                            dr["xzjbxjgs"] = checkBox107.Checked;
                            dr["xzjbxjt"] = checkBox108.Checked;
                            dr["xzjbgzdm"] = checkBox109.Checked;
                            dr["xzjbcxx"] = checkBox110.Checked;
                            dr["xzjbxqq"] = checkBox111.Checked;
                            dr["xzjbqt"] = checkBox112.Checked;
                            dr["xzjbqt_nr"] = textBox4.Text;
                            dr["xgjbwfx"] = checkBox113.Checked;
                            dr["xgjbjcdml"] = checkBox114.Checked;
                            dr["xgjbdmbs"] = checkBox115.Checked;
                            dr["xgjbqt"] = checkBox116.Checked;
                            dr["xgjbqt_nr"] = textBox5.Text;
                            dr["ybjbwfx"] = checkBox117.Checked;
                            dr["ybjbswmcx"] = checkBox118.Checked;
                            dr["ybjbsrtsz"] = checkBox119.Checked;
                            dr["ybjbbnz"] = checkBox120.Checked;
                            dr["ybjbqt"] = checkBox121.Checked;
                            dr["ybjbqt_nr"] = textBox6.Text;
                            dr["sjxtjbn"] = checkBox122.Checked;
                            dr["sjxtjby"] = checkBox124.Checked;
                            dr["sjxtjby_nr"] = textBox7.Text;
                            dr["qtxtjbn"] = checkBox123.Checked;
                            dr["qtxtjby"] = checkBox125.Checked;
                            dr["qtxtjb_nr"] = textBox8.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region 保存住院治疗情况
                            sda = new SqlDataAdapter("select * from health_inhospital", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);

                            //dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["zyrq"] = dateTimePicker2.Value.ToShortTimeString();
                            dr["cyrq"] = dateTimePicker3.Value.ToShortTimeString();
                            dr["yuanying"] = textBox9.Text;
                            dr["hostipal"] = textBox10.Text;
                            dr["bah"] = textBox11.Text;
                            dr["jtbc_jcsj"] = dateTimePicker9.Value.ToShortTimeString();
                            dr["jtbc_ccsj"] = dateTimePicker8.Value.ToShortTimeString();
                            dr["jtbc_yy"] = textBox20.Text;
                            dr["jtbc_hostipal"] = textBox19.Text;
                            dr["jtbc_bah"] = textBox18.Text;
                            dt.Rows.Add(dr);

                            if (textBox16.Text != "" || textBox13.Text != "")
                            {
                                DataRow dr1 = dt.NewRow();
                                dr1["person_healthfile_no"] = healthfile_no;
                                dr1["followup_id"] = folid;
                                dr1["zyrq"] = dateTimePicker4.Value.ToShortTimeString();
                                dr1["cyrq"] = dateTimePicker5.Value.ToShortTimeString();
                                dr1["yuanying"] = textBox12.Text;
                                dr1["hostipal"] = textBox13.Text;
                                dr1["bah"] = textBox14.Text;
                                dr1["jtbc_jcsj"] = dateTimePicker7.Value.ToShortTimeString();
                                dr1["jtbc_ccsj"] = dateTimePicker6.Value.ToShortTimeString();
                                dr1["jtbc_yy"] = textBox17.Text;
                                dr1["jtbc_hostipal"] = textBox16.Text;
                                dr1["jtbc_bah"] = textBox15.Text;
                                dt.Rows.Add(dr1);
                            }
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);

                            #endregion

                            #region 保存用药情况
                            sda = new SqlDataAdapter("select * from health_medicine", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            //dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["yaoming"] = textBox21.Text;
                            dr["yongfa"] = textBox52.Text;
                            dr["yongliang"] = textBox22.Text;
                            dr["danwei"] = comboBox22.Text;
                            dr["yysj"] = textBox23.Text;
                            dr["fyycx"] = comboBox23.Text;
                            dt.Rows.Add(dr);
                            if (textBox26.Text != "")
                            {
                                DataRow dry1 = dt.NewRow();
                                dry1["person_healthfile_no"] = healthfile_no;
                                dry1["followup_id"] = folid;
                                dry1["yaoming"] = textBox26.Text;
                                dry1["yongfa"] = textBox53.Text;
                                dry1["yongliang"] = textBox25.Text;
                                dry1["danwei"] = comboBox25.Text;
                                dry1["yysj"] = textBox24.Text;
                                dry1["fyycx"] = comboBox24.Text;
                                dt.Rows.Add(dry1);
                            }
                            if (textBox29.Text != "")
                            {
                                DataRow dry2 = dt.NewRow();
                                dry2["person_healthfile_no"] = healthfile_no;
                                dry2["followup_id"] = folid;
                                dry2["yaoming"] = textBox29.Text;
                                dry2["yongfa"] = textBox54.Text;
                                dry2["yongliang"] = textBox28.Text;
                                dry2["danwei"] = comboBox28.Text;
                                dry2["yysj"] = textBox27.Text;
                                dry2["fyycx"] = comboBox27.Text;
                                dt.Rows.Add(dry2);
                            }

                            if (textBox32.Text != "")
                            {
                                DataRow dry3 = dt.NewRow();
                                dry3["person_healthfile_no"] = healthfile_no;
                                dry3["followup_id"] = folid;
                                dry3["yaoming"] = textBox32.Text;
                                dry3["yongfa"] = textBox55.Text;
                                dry3["yongliang"] = textBox31.Text;
                                dry3["danwei"] = comboBox31.Text;
                                dry3["yysj"] = textBox30.Text;
                                dry3["fyycx"] = comboBox30.Text;
                                dt.Rows.Add(dry3);
                            }
                            if (textBox35.Text != "")
                            {
                                DataRow dry4 = dt.NewRow();
                                dry4["person_healthfile_no"] = healthfile_no;
                                dry4["followup_id"] = folid;
                                dry4["yaoming"] = textBox35.Text;
                                dry4["yongfa"] = textBox56.Text;
                                dry4["yongliang"] = textBox34.Text;
                                dry4["danwei"] = comboBox34.Text;
                                dry4["yysj"] = textBox33.Text;
                                dry4["fyycx"] = comboBox33.Text;
                                dt.Rows.Add(dry4);
                            }
                            if (textBox38.Text != "")
                            {
                                DataRow dry5 = dt.NewRow();
                                dry5["person_healthfile_no"] = healthfile_no;
                                dry5["followup_id"] = folid;
                                dry5["yaoming"] = textBox35.Text;
                                dry5["yongfa"] = textBox56.Text;
                                dry5["yongliang"] = textBox34.Text;
                                dry5["danwei"] = comboBox34.Text;
                                dry5["yysj"] = textBox33.Text;
                                dry5["fyycx"] = comboBox33.Text;
                                dt.Rows.Add(dry5);

                            }
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);


                            #endregion

                            #region  保存非免疫接种
                            sda = new SqlDataAdapter("select * from health_myjz", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            //dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["jzmc"] = textBox39.Text;
                            dr["jzrq"] = dateTimePicker10.Value.ToShortTimeString();
                            dr["jzjg"] = textBox40.Text;
                            dt.Rows.Add(dr);
                            if (textBox42.Text != "")
                            {
                                DataRow drmy1 = dt.NewRow();
                                drmy1["person_healthfile_no"] = healthfile_no;
                                drmy1["followup_id"] = folid;
                                drmy1["jzmc"] = textBox42.Text;
                                drmy1["jzrq"] = dateTimePicker11.Value.ToShortTimeString();
                                drmy1["jzjg"] = textBox41.Text;
                                dt.Rows.Add(drmy1);
                            }
                            if (textBox44.Text != "")
                            {
                                DataRow drmy2 = dt.NewRow();
                                drmy2["person_healthfile_no"] = healthfile_no;
                                drmy2["followup_id"] = folid;
                                drmy2["jzmc"] = textBox44.Text;
                                drmy2["jzrq"] = dateTimePicker12.Value.ToShortTimeString();
                                drmy2["jzjg"] = textBox43.Text;
                                dt.Rows.Add(drmy2);
                            }

                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region 保存健康评价
                            sda = new SqlDataAdapter("select * from health_opinion", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["jkpj_sf"] = comboBox39.Text;
                            dr["jkpj_yc1"] = textBox45.Text;
                            dr["jkpj_yc2"] = textBox46.Text;
                            dr["jkpj_yc3"] = textBox47.Text;
                            dr["jkpj_yc4"] = textBox48.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);

                            #endregion

                            #region   保存健康指导内容
                            sda = new SqlDataAdapter("select * from health_vote", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = folid;
                            dr["dqsf"] = checkBox129.Checked;
                            dr["mxbgl"] = checkBox128.Checked;
                            dr["jyfc"] = checkBox127.Checked;
                            dr["jyzz"] = checkBox126.Checked;
                            dr["wjy"] = checkBox130.Checked;
                            dr["wjkyj"] = checkBox131.Checked;
                            dr["wys"] = checkBox132.Checked;
                            dr["wdl"] = checkBox133.Checked;
                            dr["wjtz"] = checkBox134.Checked;
                            dr["wjtz_mb"] = textBox49.Text.ToString();
                            dr["wymjz"] = checkBox135.Checked;
                            dr["wymjz_ym"] = textBox50.Text;
                            dr["other"] = checkBox136.Checked;
                            dr["other_nr"] = textBox51.Text;
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);
                            #endregion

                            #region  在followup 表中存一条数据

                            sda = new SqlDataAdapter("select * from followup", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns["followup_id"] };
                            dr = dt.NewRow();
                            dr["person_healthfile_no"] = healthfile_no;
                            dr["followup_id"] = AutoNumber.getAutoNumber("随访");//生成新的followupid
                            if (lorc == "老")
                            {
                                dr["followup_class"] = "老年人随访";
                            }
                            if (lorc == "残")
                            {
                                dr["followup_class"] = "残疾人随访";
                            }
                            if (lorc == "")
                            {
                                dr["followup_class"] = "健康体检";
                            }
                            dr["next_followup_date"] = DateTime.Parse(dateTimePicker13.Text);
                            dr["followup_doctor"] = comboBox5.Text;
                            dr["complete"] = "未完成";
                            dt.Rows.Add(dr);
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(dt);

                            #endregion


                            bc = true;//标记是否看过第一次点保存
                            chakan = true;
                            MessageBox.Show("保存健康档案成功");
                        }
                        else
                        {
                            #region  保存修改

                            #region 修改症状
                            sda = new SqlDataAdapter("select * from health_symptom", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["yesno"] = checkBox1.Checked;
                            dr["headache"] = checkBox2.Checked;
                            dr["touyun"] = checkBox3.Checked;
                            dr["xiongmen"] = checkBox5.Checked;
                            dr["xiongtong"] = checkBox6.Checked;
                            dr["mxkesou"] = checkBox7.Checked;
                            dr["ketan"] = checkBox14.Checked;
                            dr["hxkunnan"] = checkBox13.Checked;
                            dr["duoying"] = checkBox12.Checked;
                            dr["duoniao"] = checkBox11.Checked;
                            dr["tzxiajiang"] = checkBox10.Checked;
                            dr["fali"] = checkBox9.Checked;
                            dr["slmohu"] = checkBox21.Checked;
                            dr["gjzhongtong"] = checkBox8.Checked;
                            dr["sjmamu"] = checkBox20.Checked;
                            dr["niaoji"] = checkBox19.Checked;
                            dr["jiaotong"] = checkBox18.Checked;
                            dr["bimi"] = checkBox17.Checked;
                            dr["fuxie"] = checkBox16.Checked;
                            dr["exoutu"] = checkBox15.Checked;
                            dr["yanghua"] = checkBox28.Checked;
                            dr["erming"] = checkBox27.Checked;
                            dr["rfzhongtong"] = checkBox26.Checked;
                            dr["xingji"] = checkBox4.Checked;
                            dr["other"] = checkBox25.Checked;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region  修改一般情况

                            sda = new SqlDataAdapter("select * from health_status", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["tiwen"] = textBoxX5.Text.ToString();
                            dr["mailv"] = textBoxX12.Text.ToString();
                            dr["hxpinglv"] = textBoxX6.Text.ToString();
                            dr["left_szy"] = textBoxX16.Text.ToString();
                            dr["left_shy"] = textBoxX18.Text.ToString();
                            dr["right_szy"] = textBoxX17.Text.ToString();
                            dr["right_sfy"] = textBoxX19.Text.ToString();
                            dr["shenggao"] = textBoxX7.Text.ToString();
                            dr["tizhong"] = textBoxX13.Text.ToString();
                            dr["yaowei"] = textBoxX8.Text.ToString();
                            dr["tzzhishu"] = textBoxX14.Text.ToString();
                            dr["tunwei"] = textBoxX9.Text.ToString();
                            dr["ytwbizhi"] = textBoxX15.Text.ToString();
                            dr["lrrenzhi"] = comboBox1.Text;
                            dr["rzzhongfeng"] = textBoxX11.Text.ToString();
                            dr["lrqinggan"] = comboBox2.Text;
                            dr["qgzhongfeng"] = textBoxX10.Text.ToString();
                            dr["followup_class"] = comboBox40.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });

                            #endregion

                            #region 修改生活方式
                            sda = new SqlDataAdapter("select * from health_lifeway", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["dlpinglv"] = comboBox3.Text;
                            dr["dlshijian"] = textBoxX20.Text;
                            dr["jcdlshijian"] = textBoxX21.Text;
                            dr["dlfangshi"] = textBoxX22.Text;
                            dr["jtxwshijian"] = textBoxX23.Text;
                            dr["xyzhuangkuang"] = comboBox4.Text;
                            dr["rxyl"] = textBoxX24.Text;
                            dr["startage"] = textBoxX25.Text;
                            dr["stopage"] = textBoxX27.Text;
                            dr["mzbdxyqky"] = radioButton37.Checked;
                            dr["mzbdxyqkn"] = radioButton38.Checked;
                            dr["yjpinglv"] = comboBox6.Text;
                            dr["yjliang"] = textBoxX26.Text;
                            dr["ksyjnl"] = textBoxX29.Text;
                            dr["sfjjy"] = radioButton2.Checked;
                            dr["sfjjn"] = radioButton1.Checked;
                            dr["jjage"] = textBoxX30.Text;
                            dr["ynzjy"] = radioButton4.Checked;
                            dr["ynzjn"] = radioButton3.Checked;
                            dr["jiye"] = textBoxX45.Text;
                            dr["cysj"] = textBoxX48.Text;
                            dr["hxp"] = textBoxX33.Text;
                            dr["duwu"] = textBoxX34.Text;
                            dr["shexian"] = textBoxX35.Text;
                            dr["hxpfhy"] = radioButton7.Checked;
                            dr["hxpfhn"] = radioButton8.Checked;
                            dr["dwfhy"] = radioButton9.Checked;
                            dr["dwfhn"] = radioButton10.Checked;
                            dr["sxfhy"] = radioButton11.Checked;
                            dr["sxfhn"] = radioButton12.Checked;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region 修改饮食习惯
                            sda = new SqlDataAdapter("select * from health_ysxg", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["ysjh"] = checkBox22.Checked;
                            dr["yswz"] = checkBox23.Checked;
                            dr["sswz"] = checkBox24.Checked;
                            dr["sy"] = checkBox29.Checked;
                            dr["shiy"] = checkBox30.Checked;
                            dr["st"] = checkBox31.Checked;
                            dr["baijiu"] = checkBox36.Checked;
                            dr["pijiu"] = checkBox35.Checked;
                            dr["hongjiu"] = checkBox34.Checked;
                            dr["huangjiu"] = checkBox33.Checked;
                            dr["other"] = checkBox32.Checked;
                            dr["other_nr"] = textBoxX28.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region 修改脏器功能
                            sda = new SqlDataAdapter("select * from health_viscera", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["kchr"] = checkBox41.Checked;
                            dr["kccb"] = checkBox40.Checked;
                            dr["kcfg"] = checkBox39.Checked;
                            dr["kcjl"] = checkBox38.Checked;
                            dr["kcbz"] = checkBox37.Checked;
                            dr["clzc"] = checkBox40.Checked;
                            dr["clqc"] = checkBox45.Checked;
                            dr["clyc"] = checkBox44.Checked;
                            dr["clyy"] = checkBox43.Checked;
                            dr["ybwcx"] = checkBox51.Checked;
                            dr["ybcx"] = checkBox50.Checked;
                            dr["ybzs"] = checkBox49.Checked;
                            dr["left_sl"] = textBoxX36.Text;
                            dr["right_sl"] = textBoxX37.Text;
                            dr["left_jzsl"] = textBoxX38.Text;
                            dr["right_jzsl"] = textBoxX39.Text;
                            dr["tingli"] = comboBox7.Text;
                            dr["yundong"] = comboBox8.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region 修改查体
                            sda = new SqlDataAdapter("select * from health_check", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["xinglv"] = textBoxX44.Text.ToString();
                            dr["xinglu"] = comboBox9.Text;
                            dr["xjshuizhong"] = comboBox10.Text;
                            dr["zbdmbd"] = comboBox11.Text;
                            dr["pfzc"] = checkBox55.Checked;
                            dr["pfch"] = checkBox54.Checked;
                            dr["pfcb"] = checkBox53.Checked;
                            dr["pffg"] = checkBox52.Checked;
                            dr["pfhy"] = checkBox48.Checked;
                            dr["pfsscz"] = checkBox47.Checked;
                            dr["pfqt"] = checkBox42.Checked;
                            dr["other_nr"] = textBoxX40.Text;
                            dr["gmzc"] = checkBox59.Checked;
                            dr["gmhr"] = checkBox58.Checked;
                            dr["gmcx"] = checkBox57.Checked;
                            dr["gmqt"] = checkBox56.Checked;
                            dr["gmother_nr"] = textBoxX41.Text;
                            dr["lbjwcj"] = checkBox63.Checked;
                            dr["lbjsgs"] = checkBox62.Checked;
                            dr["lbjyw"] = checkBox61.Checked;
                            dr["lbjqt"] = checkBox60.Checked;
                            dr["lbjother_nr"] = textBoxX42.Text;
                            dr["tzxy"] = radioButton6.Checked;
                            dr["tzxn"] = radioButton41.Checked;
                            dr["hxyy"] = radioButton43.Checked;
                            dr["hxyn"] = radioButton42.Checked;
                            dr["lyw"] = checkBox71.Checked;
                            dr["lygly"] = checkBox70.Checked;
                            dr["lysly"] = checkBox69.Checked;
                            dr["lyqt"] = checkBox68.Checked;
                            dr["lyother_nr"] = textBoxX43.Text;
                            dr["xzzyw"] = radioButton54.Checked;
                            dr["xzzyy"] = radioButton55.Checked;
                            dr["xzzy_nr"] = textBoxX49.Text;
                            dr["ytw"] = radioButton44.Checked;
                            dr["yty"] = radioButton45.Checked;
                            dr["bkw"] = radioButton46.Checked;
                            dr["bky"] = radioButton49.Checked;
                            dr["gdw"] = radioButton47.Checked;
                            dr["gdy"] = radioButton50.Checked;
                            dr["bdw"] = radioButton48.Checked;
                            dr["bdy"] = radioButton50.Checked;
                            dr["ydxzyw"] = radioButton53.Checked;
                            dr["ydxzyy"] = radioButton52.Checked;
                            dr["gmzzwjyc"] = checkBox91.Checked;
                            dr["gmzzcj"] = checkBox90.Checked;
                            dr["gmzzbk"] = checkBox89.Checked;
                            dr["gmzzqlx"] = checkBox88.Checked;
                            dr["gmzzqt"] = checkBox92.Checked;
                            dr["gmzzother_nr"] = textBoxX47.Text;
                            dr["rxwjyc"] = checkBox87.Checked;
                            dr["rxrfqc"] = checkBox86.Checked;
                            dr["rxycmr"] = checkBox85.Checked;
                            dr["rxyxbk"] = checkBox84.Checked;
                            dr["rxqt"] = checkBox93.Checked;
                            dr["rxother_nr"] = textBoxX46.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region 修改查体妇科
                            sda = new SqlDataAdapter("select * from health_woman", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["wywyc"] = radioButton27.Checked;
                            dr["wyyc"] = radioButton28.Checked;
                            dr["ydwyc"] = radioButton29.Checked;
                            dr["ydyc"] = radioButton33.Checked;
                            dr["gjwyc"] = radioButton30.Checked;
                            dr["gjyc"] = radioButton34.Checked;
                            dr["gtwyc"] = radioButton31.Checked;
                            dr["gtyc"] = radioButton35.Checked;
                            dr["fjwyc"] = radioButton32.Checked;
                            dr["fjyc"] = radioButton36.Checked;
                            dr["wy_nr"] = textBoxX50.Text;
                            dr["yd_nr"] = textBoxX51.Text;
                            dr["gj_nr"] = textBoxX52.Text;
                            dr["gt_nr"] = textBoxX86.Text;
                            dr["fj_nr"] = textBoxX87.Text;
                            dr["other"] = textBoxX53.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region  修改辅助检查
                            sda = new SqlDataAdapter("select * from health_assistant", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["kfxuetang"] = textBoxX55.Text.ToString();
                            dr["xhdanbai"] = textBoxX56.Text.ToString();
                            dr["bxibao"] = textBoxX57.Text.ToString();
                            dr["xxiaoban"] = textBoxX58.Text.ToString();
                            dr["xother"] = textBoxX60.Text;
                            dr["ndanbai"] = textBoxX63.Text.ToString();
                            dr["niaotang"] = textBoxX62.Text.ToString();
                            dr["ntongti"] = textBoxX61.Text.ToString();
                            dr["nqianxue"] = textBoxX64.Text.ToString();
                            dr["nother"] = textBoxX60.Text;
                            dr["dbqxn"] = radioButton25.Checked;
                            dr["dbqxy"] = radioButton26.Checked;
                            dr["nwldb"] = textBoxX65.Text.ToString();
                            dr["xqgbzam"] = textBoxX69.Text.ToString();
                            dr["xqgczam"] = textBoxX68.Text.ToString();
                            dr["bdanbai"] = textBoxX67.Text.ToString();
                            dr["zdhs"] = textBoxX66.Text.ToString();
                            dr["jhdhs"] = textBoxX74.Text.ToString();
                            dr["xqjg"] = textBoxX73.Text.ToString();
                            dr["xnsa"] = textBoxX72.Text.ToString();
                            dr["xjnd"] = textBoxX71.Text.ToString();
                            dr["xnnd"] = textBoxX75.Text.ToString();
                            dr["zdgc"] = textBoxX78.Text.ToString();
                            dr["gysz"] = textBoxX77.Text.ToString();
                            dr["xqdmdzdbdgc"] = textBoxX76.Text.ToString();
                            dr["xqgmdzdbdgc"] = textBoxX70.Text.ToString();
                            dr["thxhdb"] = textBoxX79.Text.ToString();
                            dr["ygbmkyy"] = radioButton13.Checked;
                            dr["ygbmkyn"] = radioButton14.Checked;
                            dr["ydzc"] = radioButton15.Checked;
                            dr["ydyc"] = radioButton16.Checked;
                            dr["ydyc_nr"] = textBoxX84.Text;
                            dr["xdtzc"] = radioButton17.Checked;
                            dr["xdtyc"] = radioButton21.Checked;
                            dr["xdtyc_nr"] = textBoxX83.Text;
                            dr["xbxsxzc"] = radioButton18.Checked;
                            dr["xbxsxyc"] = radioButton22.Checked;
                            dr["xbxsxyc_nr"] = textBoxX82.Text;
                            dr["bczc"] = radioButton19.Checked;
                            dr["bcyc"] = radioButton23.Checked;
                            dr["bcyc_nr"] = textBoxX81.Text;
                            dr["gjtpzc"] = radioButton57.Checked;
                            dr["gjtpyc"] = radioButton56.Checked;
                            dr["gjtpyc_nr"] = textBoxX88.Text;
                            dr["other"] = textBoxX89.Text;
                            dr["pinghz"] = comboBox12.Text;
                            dr["qixz"] = comboBox13.Text;
                            dr["yangxz"] = comboBox14.Text;
                            dr["yinxz"] = comboBox15.Text;
                            dr["tansz"] = comboBox16.Text;
                            dr["shirz"] = comboBox17.Text;
                            dr["xueyz"] = comboBox18.Text;
                            dr["qiyz"] = comboBox19.Text;
                            dr["tebz"] = comboBox20.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region 修改现存主要健康问题
                            sda = new SqlDataAdapter("select * from health_issue", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["nxgjwfx"] = checkBox94.Checked;
                            dr["nxgqxzz"] = checkBox95.Checked;
                            dr["nxgncx"] = checkBox96.Checked;
                            dr["nxgzwmxqcx"] = checkBox97.Checked;
                            dr["nxgdzxqx"] = checkBox98.Checked;
                            dr["nxgqt"] = checkBox99.Checked;
                            dr["nxgqt_nr"] = textBox2.Text;
                            dr["sbwfx"] = checkBox105.Checked;
                            dr["sbtnbsb"] = checkBox100.Checked;
                            dr["sbsgnxj"] = checkBox101.Checked;
                            dr["sbjxsy"] = checkBox102.Checked;
                            dr["sbmxsy"] = checkBox103.Checked;
                            dr["sbqt"] = checkBox104.Checked;
                            dr["sbqt_nr"] = textBox3.Text;
                            dr["xzjbwfx"] = checkBox106.Checked;
                            dr["xzjbxjgs"] = checkBox107.Checked;
                            dr["xzjbxjt"] = checkBox108.Checked;
                            dr["xzjbgzdm"] = checkBox109.Checked;
                            dr["xzjbcxx"] = checkBox110.Checked;
                            dr["xzjbxqq"] = checkBox111.Checked;
                            dr["xzjbqt"] = checkBox112.Checked;
                            dr["xzjbqt_nr"] = textBox4.Text;
                            dr["xgjbwfx"] = checkBox113.Checked;
                            dr["xgjbjcdml"] = checkBox114.Checked;
                            dr["xgjbdmbs"] = checkBox115.Checked;
                            dr["xgjbqt"] = checkBox116.Checked;
                            dr["xgjbqt_nr"] = textBox5.Text;
                            dr["ybjbwfx"] = checkBox117.Checked;
                            dr["ybjbswmcx"] = checkBox118.Checked;
                            dr["ybjbsrtsz"] = checkBox119.Checked;
                            dr["ybjbbnz"] = checkBox120.Checked;
                            dr["ybjbqt"] = checkBox121.Checked;
                            dr["ybjbqt_nr"] = textBox6.Text;
                            dr["sjxtjbn"] = checkBox122.Checked;
                            dr["sjxtjby"] = checkBox124.Checked;
                            dr["sjxtjby_nr"] = textBox7.Text;
                            dr["qtxtjbn"] = checkBox123.Checked;
                            dr["qtxtjby"] = checkBox125.Checked;
                            dr["qtxtjb_nr"] = textBox8.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #region 修改住院情况
                            sda = new SqlDataAdapter("select * from health_inhospital" + "  where  followup_id='" + followupid + "'", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dr = dt.Rows[0];
                            dr["zyrq"] = dateTimePicker2.Value.ToShortTimeString();
                            dr["cyrq"] = dateTimePicker3.Value.ToShortTimeString();
                            dr["yuanying"] = textBox9.Text;
                            dr["hostipal"] = textBox10.Text;
                            dr["bah"] = textBox11.Text;
                            dr["jtbc_jcsj"] = dateTimePicker9.Value.ToShortTimeString();
                            dr["jtbc_ccsj"] = dateTimePicker8.Value.ToShortTimeString();
                            dr["jtbc_yy"] = textBox20.Text;
                            dr["jtbc_hostipal"] = textBox19.Text;
                            dr["jtbc_bah"] = textBox18.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            int zyrows = dt.Rows.Count;
                            if (zyrows == 2)
                            {
                                dr = dt.Rows[1];
                                dr["zyrq"] = dateTimePicker4.Value.ToShortTimeString();
                                dr["cyrq"] = dateTimePicker5.Value.ToShortTimeString();
                                dr["yuanying"] = textBox12.Text;
                                dr["hostipal"] = textBox13.Text;
                                dr["bah"] = textBox14.Text;
                                dr["jtbc_jcsj"] = dateTimePicker7.Value.ToShortTimeString();
                                dr["jtbc_ccsj"] = dateTimePicker6.Value.ToShortTimeString();
                                dr["jtbc_yy"] = textBox17.Text;
                                dr["jtbc_hostipal"] = textBox16.Text;
                                dr["jtbc_bah"] = textBox15.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });
                            }

                            #endregion

                            #region 修改用药情况
                            sda = new SqlDataAdapter("select * from health_medicine" + "  where  followup_id='" + followupid + "'", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dr = dt.Rows[0];
                            dr["yaoming"] = textBox21.Text;
                            dr["yongfa"] = textBox52.Text;
                            dr["yongliang"] = textBox22.Text;
                            dr["danwei"] = comboBox22.Text;
                            dr["yysj"] = textBox23.Text;
                            dr["fyycx"] = comboBox23.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            int yyrows = dt.Rows.Count;  //用药情况行数
                            if (yyrows == 2)
                            {
                                dr = dt.Rows[1];
                                dr["yaoming"] = textBox26.Text;
                                dr["yongfa"] = textBox53.Text;
                                dr["yongliang"] = textBox25.Text;
                                dr["danwei"] = comboBox25.Text;
                                dr["yysj"] = textBox24.Text;
                                dr["fyycx"] = comboBox24.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });
                            }
                            if (yyrows == 3)
                            {
                                dr = dt.Rows[2];
                                dr["yaoming"] = textBox29.Text;
                                dr["yongfa"] = textBox54.Text;
                                dr["yongliang"] = textBox28.Text;
                                dr["danwei"] = comboBox28.Text;
                                dr["yysj"] = textBox27.Text;
                                dr["fyycx"] = comboBox27.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });
                            }
                            if (yyrows == 4)
                            {
                                dr = dt.Rows[3];
                                dr["yaoming"] = textBox32.Text;
                                dr["yongfa"] = textBox55.Text;
                                dr["yongliang"] = textBox31.Text;
                                dr["danwei"] = comboBox31.Text;
                                dr["yysj"] = textBox30.Text;
                                dr["fyycx"] = comboBox30.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });

                            }
                            if (yyrows == 5)
                            {
                                dr = dt.Rows[4];
                                dr["yaoming"] = textBox35.Text;
                                dr["yongfa"] = textBox56.Text;
                                dr["yongliang"] = textBox34.Text;
                                dr["danwei"] = comboBox34.Text;
                                dr["yysj"] = textBox33.Text;
                                dr["fyycx"] = comboBox33.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });

                            }

                            if (yyrows == 6)
                            {
                                dr = dt.Rows[5];
                                dr["yaoming"] = textBox35.Text;
                                dr["yongfa"] = textBox56.Text;
                                dr["yongliang"] = textBox34.Text;
                                dr["danwei"] = comboBox34.Text;
                                dr["yysj"] = textBox33.Text;
                                dr["fyycx"] = comboBox33.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });

                            }
                            #endregion

                            #region 修改非免疫接种
                            sda = new SqlDataAdapter("select * from health_myjz" + "  where  followup_id='" + followupid + "'", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dr = dt.Rows[0];
                            dr["jzmc"] = textBox39.Text;
                            dr["jzrq"] = dateTimePicker10.Value.ToShortTimeString();
                            dr["jzjg"] = textBox40.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            int mygh = dt.Rows.Count;
                            if (mygh == 2)
                            {
                                dr = dt.Rows[1];
                                dr["followup_id"] = folid;
                                dr["jzmc"] = textBox42.Text;
                                dr["jzrq"] = dateTimePicker11.Value.ToShortTimeString();
                                dr["jzjg"] = textBox41.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });
                            }
                            if (mygh == 3)
                            {
                                dr = dt.Rows[2];
                                dr["jzmc"] = textBox44.Text;
                                dr["jzrq"] = dateTimePicker12.Value.ToShortTimeString();
                                dr["jzjg"] = textBox43.Text;
                                scb = new SqlCommandBuilder(sda);
                                sda.Update(new DataRow[] { dr });


                            }
                            #endregion

                            #region  修改健康状态
                            sda = new SqlDataAdapter("select * from health_opinion", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["jkpj_sf"] = comboBox39.Text;
                            dr["jkpj_yc1"] = textBox45.Text;
                            dr["jkpj_yc2"] = textBox46.Text;
                            dr["jkpj_yc3"] = textBox47.Text;
                            dr["jkpj_yc4"] = textBox48.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });

                            #endregion
                            #region  修改健康指导内容
                            sda = new SqlDataAdapter("select * from health_vote", Dbconnect.s1);
                            dt = new DataTable();
                            sda.Fill(dt);
                            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
                            dr = dt.Rows.Find(followupid);
                            dr["dqsf"] = checkBox129.Checked;
                            dr["mxbgl"] = checkBox128.Checked;
                            dr["jyfc"] = checkBox127.Checked;
                            dr["jyzz"] = checkBox126.Checked;
                            dr["wjy"] = checkBox130.Checked;
                            dr["wjkyj"] = checkBox131.Checked;
                            dr["wys"] = checkBox132.Checked;
                            dr["wdl"] = checkBox133.Checked;
                            dr["wjtz"] = checkBox134.Checked;
                            dr["wjtz_mb"] = textBox49.Text.ToString();
                            dr["wymjz"] = checkBox135.Checked;
                            dr["wymjz_ym"] = textBox50.Text;
                            dr["other"] = checkBox136.Checked;
                            dr["other_nr"] = textBox51.Text;
                            scb = new SqlCommandBuilder(sda);
                            sda.Update(new DataRow[] { dr });
                            #endregion

                            #endregion

                        }


                    }
                    else
                    {
                        MessageBox.Show("该居民档案已经归档，不可再进行操作");
                    }

                }
                catch (Exception e1)
                {
                    

                }
                finally
                {
                    if (conn.State == ConnectionState.Open)
                    {
                        conn.Close();
                    }
                }
            

            }
        }

       
        
       
    }
}